$(function(){
	$("#header").load("register_login_head.html?="+Math.random());
	$("#footer").load("register_login_footer.html?="+Math.random());
	$(window).load(function(){
		var name=$.cookie("登录状态");
		var json_name=JSON.parse(name);
		
		$("p span").html(json_name);
		var address=$.cookie("收货地址");
		var json_address=JSON.parse(address);
		console.log(json_address);
		var html=""
		$.each(json_address,function(index,conment){
			if(conment["name"]==json_name){
				html+="<p>"+conment["address"]+"<input type='checkbox'>"+"</p>";
			}
		});
		$(".address").html(html);
		//
		var goods=$.cookie("购物车信息");
		var json_goods=JSON.parse(goods);
		//console.log(json_goods);
		var html=""
		$.each(json_goods, function(index,conmet) {
			//console.log(json_goods)
			if(conmet["name"]==json_name){
				console.log(conmet["name"]);
				$.get("json/page_date.json",function(page_date,textstatus){
					//console.log(page_date)
					
					$.each(page_date, function(index,comments) {
						if(comments["id"]==conmet["good_id"]){
							//console.log(comments["id"]);
							html+="<p>"+comments["title"]+"&nbsp"+comments["price"]+"</p>"
							console.log(comments["price"]);
						}
					});
					$(".buy_car").html(html);
					
				})
			}
		});
		
	})
})
